home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / sys / amiga / programmer / 2653 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  13.9 KB

  1. Path: grafix.xs4all.nl!john.hendrikx
  2. Date: Fri, 02 Feb 96 20:55:54 GMT+1
  3. Newsgroups: comp.sys.amiga.programmer
  4. Distribution: world
  5. Subject: Re: Amiga doesn`t need Planar!
  6. MIME-Version: 1.0
  7. Content-Type: text/plain; charset=iso-8859-1
  8. Content-Transfer-Encoding: 8bit
  9. From: john.hendrikx@grafix.xs4all.nl (John Hendrikx)
  10. Message-ID: <john.hendrikx.4b7o@grafix.xs4all.nl>
  11. Organization: Grafix Attack BBS Holland
  12.  
  13. In a message of 31 Jan 96 Juergen "rally" Fischer wrote to All:
  14.  
  15.  >>  TlM> Planar rules, its far more flexible, you don`t need 256 colours
  16.  >> worth
  17.  >>  TlM> of bitmap memory for a 2 color screen, etc. i.e you just use 2
  18.  >> Colours
  19.  
  20.  >> Tell me, how much gfx-memory-accesses does it take to draw a simple 100
  21.  >> pixel vertical line on a 7-bit Planar display?
  22.  
  23.  JrF> worst case example ;)
  24.  
  25. Yes, but if lines have 'random' angles then you'll find that 50% of these could
  26. be considered 'vertical' (ie, only 1 pixel per row).  Then 25% of the remaining
  27. 50% of possible line angles has to plot 1 or 2 pixels per row (again very bad).
  28.  Only a very small portion of lines (ie, the near horizontal ones) drawn are
  29. -nearly- as fast as they would be in Chunky (at same depth).
  30.  
  31.  >> Another example;
  32.  
  33.  >> You have a 12-bit planar screen, and you want to blit an object of 40x40
  34.  >> pixels
  35.  
  36.  >> You have a 16-bit Chunky screen (ie, again better quality) and you want
  37.  >> to blit
  38.  
  39.  JrF> True, for small BOBs the planar overhead is bigger. BTW edges of 16bit
  40.  JrF> objs also need special handling, i.e. switching from LONG to WORD write
  41.  JrF> at edges.
  42.  
  43. Yes, true, but I assumed pixels would be plotted one WORD at the time. 
  44. Plotting LONGs were possible would be a possible optimisation which I didn't
  45. even take into acount.
  46.  
  47.  JrF> But when it comes up to larger BOBs, 12bit should become faster in
  48.  JrF> most cases.
  49.  
  50. The bob would have to be pretty large before it is faster, I'd say it would
  51. have to be more than 100 pixels wide before this happens, and well, games seem
  52. to favour smaller bobs (especially the ones running on LoRes).
  53.  
  54.  JrF> "Not writing the zeros" on chunky display is not always faster,
  55.  JrF> example is chunky mapping to fastmem on 020/030. Of course special
  56.  JrF> hardware can handle this, we also assume special hardware on planar
  57.  JrF> (bitblitter), without it you can't get all horiz positions for BOBs
  58.  JrF> without a megacpu.
  59.  
  60. Yes, I was assuming blitter hardware here, which can check for zero to see
  61. whether the destination should be modified or not.  This makes masking really
  62. fast and easy as no seperate mask is needed.  Planar hardware would have to do
  63. extra reads to get the mask.
  64.  
  65.  JrF> Well, a trick that chunky can't do is for example only copying 6
  66.  JrF> planes, and zero storing to the rest of the 6 planes, saves you 6
  67.  JrF> planes reading. Gives you 64 colors out of the 2^12.
  68.  
  69. It is of little use though :-(
  70.  
  71.  JrF> it all depends, and for 2D games planar was and still is an advantage.
  72.  
  73. I'm not so sure, lots of cool effects can be done with Chunky even for 2d
  74. games.
  75.  
  76.  >>  TlM> Amiga Rules... Custom Chips Rule..
  77.  
  78.  >> (My?) definition of Amiga:  Anything which runs *REAL* Amiga software
  79.  >> like DirOpus, AdPro, Final Writer, WorkBench, AmigaShell, etcetera...
  80.  
  81.  JrF> Allthough having not such extreme opinions, I fully agree with the 2
  82.  JrF> statements.
  83.  
  84.  JrF> Amiga rules: no comment nessesary ;) ... well, the interesting thing
  85.  JrF> is that if you look at the OS, there are things where the term "Only
  86.  JrF> Amiga makes it possible" is just true and not fanatism. And when I see
  87.  JrF> 50Hz virtual screen and 50Hz mousepointer, then I can say that AGA got
  88.  JrF> at least some goodies seen on no other "superior" hardware.
  89.  
  90. 50Hz Mouse pointer is no problem on modern gfx-cards, they've got a special
  91. sprite for that.  The problem is Windows.
  92.  
  93.  JrF> Custom Chips rule: Well I gave already the mousepointer example, and
  94.  JrF> immedeately got to admit you got not much fun if you direct it over a
  95.  JrF> flickering dbl screen because no more bandwidth. BUT: I don't see AGA
  96.  JrF> as something you got to compare with the newest S3 chipset (thinking
  97.  JrF> about wb screens here). Just run WB on a gfxcard to compare, or put out
  98.  JrF> the gfx-card of the clone to compare ;)
  99.  
  100. Do you know what I dislike most about Amiga?  The fact that a MAC Emulator can
  101. run all MAC software on my Amiga, but my Amiga can't run all Amiga software. 
  102. Maybe we should fix that problem first?  Maybe we should write an Amiga
  103. emulator FOR Amiga so we can run all our Amiga software?
  104.  
  105.  JrF> But when it comes to games, I say: AGA is still very usable today.
  106.  
  107. How can you say that?  What do you mean 'games'?  I think your definition of
  108. games needs adjusting.  What I see on the clones, and the consoles is what I
  109. call games.  Not the AGA crap we have to put up with.
  110.  
  111.  JrF> Anyone should have checked it can do chunky without delay on most
  112.  JrF> configs. And, take 2x2 on A1200, here AGA performs better in chunky
  113.  JrF> games than a gfx card would (!) so it doesn't sound like a joke if you
  114.  JrF> say custom chips rule.
  115.  
  116. Do you actually count that as an advantage???  You mean that AGA can do 2x2
  117. faster than gfx-card because on a gfx-card you would have to plot each pixel
  118. four times to get 2x2?
  119.  
  120.  JrF> Yes, the low bandwidth does brake performance on fast cpus, but the
  121.  JrF> difference vs. a average gfx card when running a chunky clone is less
  122.  JrF> than most people think. You'd need to compare AGA with a very good
  123.  JrF> gfx-card (above 15mb/sec) to have some fps difference. Anyway, when
  124.  
  125. Definitely not.  Maybe at 2x2 because most gfx-cards can't do 2x2 'standard',
  126. but then I could always use the 'blitterzoom' function on the gfx-card to get
  127. 2x2.  Oh, BTW, FastRAM on my Amiga (60 ns) can only do 10 MB/sec at copying
  128. memory.  I think that should easily beat AGA, even if I have to plot every
  129. pixel 4 times.
  130.  
  131.  JrF> having spent lotsa $ for the 060, a gfx-card should not be that
  132.  JrF> problem. software maybe is...
  133.  
  134. replace software for 'games and demos'.
  135.  
  136.  JrF> So I don't cry for new chipset for games, I cry for the new A1200
  137.  JrF> beeing delivered with some fastmem, even 1mb would help A LOT.
  138.  
  139. Sigh...
  140.  
  141.  JrF> Later AGA+ having 10 planes etc, would be a nice thing, yes.
  142.  
  143. Please not, 10 planes would be fucking slow.  For me planar maxes out at around
  144. 6 or 7 bitplanes.  It starts to seriously suck above that compared with Chunky.
  145.  
  146.  >>  TlM> HIT THE HARDWARE! HIT THE HARDWARE! HIT THE HARDWARE! HIT THE
  147.  >>  TlM> HARDWARE!
  148.  
  149.  >> Spoken like a true retired C-64 coder.
  150.  
  151.  JrF> well... When cleverly using OS routines, you also hit the hardware, you
  152.  JrF> invoke efficient pokes. Poking blitter is even called legal by Michael
  153.  JrF> ;) (after a  check)
  154.  
  155. Poking the blitter even after a check should be avoided as much as possible
  156. IMO.  I'd hate to see software fail because they say "can't find the old
  157. terribly slow Amiga blitter which is the only blitter I know how to poke
  158. directly".
  159.  
  160.  JrF> And some things are not covered by current OS  ($102 change each
  161.  JrF> scanline), so you need own copperlists (OS user coperlists allow no
  162.  JrF> horiz cwait above x=222...). Just make sure the user works on
  163.  JrF> AGA&PAL/NTSC.
  164.  
  165. Copper will die anyway.  Look at gfx-cards on Amiga today, that's what the
  166. future is going to look like.  No Copper, no hardware to poke (that you would
  167. now about), Chunky and Planar support only to about 4 bitplanes.  You might as
  168. well get used to it.
  169.  
  170.  >> Taking a better look at Chunky before dumping it like that might give you
  171.  >> a better perspective as to why some people actually think Chunky is often
  172.  >> better than Planar.  Chunky is used by the clones, that's no reason
  173.  >> however to deny
  174.  
  175.  JrF> I don't like those "doom got no gameplay we need no chunky" posts. 99%
  176.  JrF> of those posters just tell (think?) that way because there is no real
  177.  JrF> clone on the Ami, and mostly those people don't know that chunky is not
  178.  JrF> the problem, like the original poster.
  179.  
  180. Oh, but Chunky definitely is part of the problem.  I mean, a good 1x1 convertor
  181. (I don't care for 2x2 or other crap people have come up with to create inferior
  182. displays on Amiga) takes 30-40% on Amiga for a DOOM-clone.  Part of that is of
  183. course caused by the slow ChipRAM, but that 30-40% does not include the
  184. accesses to the FastRAM buffer.  It is just a fact that a DOOM clone on Amiga
  185. could be 30-40% faster with even some of the worst Chunky-cards available now.
  186.  
  187.  JrF> they would talk different if there was a clones, and building your
  188.  JrF> oppinion in that subjective way is lame.
  189.  
  190. You forget that you still need a 68040 atleast to do DOOM even if you had a
  191. super-fast Chunky card.  That's why there is no clone, the C2P problem only
  192. makes it worse though, on Amiga you'd require a 68060 to do fast DOOM (TextDemo
  193. runs only 15-20 FPS on a 68060/50, 320x240x8 1x1, floors, walls, ceiling, quite
  194. depressing).
  195.  
  196.  JrF> I LOVE DOOM. Don't tell me about gameplay, you can do other games with
  197.  JrF> the same engine, that's not the topic.
  198.  JrF> At least I love 3D mapping engines, and I won't change my mind just
  199.  JrF> because there is still no real clone.
  200.  
  201. See above, you will never see a fast DOOM clone, ChipRAM combined with planar
  202. just screws everything up (1x1 of course and full-screen).
  203.  
  204.  JrF> Instead I measured fps and had to find out that there are  _wolf_
  205.  JrF> clones that are not much faster than Johns good old Texdemo57, which
  206.  JrF> does realdoom. What about a new version, John :) If I may tell my
  207.  JrF> wishes, give me blitter assisted 2x2 and possibilty to switch to
  208.  JrF> non-shaded 16cyle 020 inner loop or even that 32x32 fake for the floor
  209.  JrF> :)
  210.  
  211. Never.  2x2 is not DOOM, it just makes things unplayable and lame.  Blitter
  212. assisting is also too limited to be of good use.
  213.  
  214. Your right about the Wolf clones though, NeMac4 seems slower than TextDemo on
  215. my machine at same res.
  216.  
  217.  JrF> I'm fed up with 1/2 speed clones. Well, maybe ID soft really has some
  218.  JrF> programmers that know how to map and how to bsp.
  219.  
  220. BSP is easy, and I know exactly how DOOM works now.  My problem at the moment
  221. is that I want the perfect DOOM engine.  TextDemo currently uses a non-perfect
  222. routine which
  223. -works-, yes, but it is not optimal.  It uses a huge table to store information
  224. during mapping but the table isn't needed at all if I rewrote the engine.
  225.  
  226. In short a DOOM engine should be done like this (there are other ways of doing
  227. a DOOM engine using only horizontal and vertical polygons (probably the way
  228. AB3d does it) but this is how DOOM does it (I'm very sure of it as my own
  229. engine matches the DOOM engine very well when it comes to 'side-effects' and
  230. things which it can and can't do):
  231.  
  232.  - Ask the BSP tree routine to give you the closest wall to the player.
  233.  
  234.  - Check if this wall is visible by comparing it with the field of
  235.    vision.  Also check which side is facing the player (but do not
  236.    discard the wall if it faces away from the player).
  237.  
  238.  - Now process this single wall.  It is best to rotate the wall first
  239.    (if you hadn't done that already above).  Now you can calc all the
  240.    intersection points of the wall with the 320 possible rays.
  241.  
  242.  - Process each intersection in turn directly after you found it (this
  243.    is TextDemo's mistake, it stores all the points in a HUGE table).
  244.    Find out the distance of each wall-column to the player's baseline
  245.    (if you rotated the wall this is simply the X or Y coordinate).
  246.  
  247.  - Draw the wall-column, and store the top and bottom edge of the wall
  248.    column in a table with 4 entries for each column on screen.  There
  249.    are 2 entries to keep track of the ceiling, and 2 entries to keep
  250.    track of the floors.  They keep track of the highest and lowest
  251.    coordinates where walls were drawn at.  If the wall faces away
  252.    from the player then don't draw it, but you still store the lowest
  253.    and highest coordinates of the wall into the table (needed to draw
  254.    floors and ceilings properly).  The entries you modify depend on the
  255.    kind of wall you draw.  There are 3 types of walls, a wall which is
  256.    only part of the ceiling (it connects 2 ceilings with each other), a wall
  257.    which is part of a floor and a ceiling (ie, it connects a floor and a
  258.    ceiling) and a wall which is only part of the floor.
  259.  
  260.  - After having finished drawing this single wall you immediately draw
  261.    the floor and ceiling above and below it (TextDemo doesn't do that
  262.    either, it draws ALL walls first, and then draws floors and ceilings).
  263.  
  264.  - You know draw the floor and ceiling below and above the wall you just
  265.    drew using the table.  Depending on how wide the wall is this can
  266.    be just a very small vertical strip of floor or ceiling you need to
  267.    draw.  The advantage however is that you don't need a huge table to
  268.    keep track of the start/end Y points of all the walls.  You need to
  269.    use a special "Vertical-strips"-to-"Horizontal-strips" convertor
  270.    which I created for TextDemo to be able to map floors and ceilings
  271.    horizontally.
  272.  
  273.  - NOW you process the next wall, by again asking the BSP tree for
  274.    the next closest wall (go to step 1).
  275.  
  276. The routine stops drawing as soon as you've a 'inpenatrable' wall-column at
  277. each of the 320 columns on screen (you can use a simple counter to keep track
  278. of this).  An inpenatrable wall is a wall which is connected directly to the
  279. floor and ceiling (so the wall is not part of the floor alone, or the ceiling
  280. alone).
  281.  
  282. I don't suspect to see a huge speed-up in TextDemo when I make this change but
  283. it may well be faster.  The big problem right now with TextDemo that the table
  284. it uses to store all the walls is never big enough.  It depends on how the
  285. level is created.  When you stand in front of a 20 step staircase the table
  286. would need to be 20 layers deep (which it is at the moment).  A longer
  287. staircase with more steps would however make things go seriously wrong as the
  288. table overflows.  The table solution therefore is never adequate and I need to
  289. remove it.  This involves completely rewriting the engine though :-(
  290.  
  291. Grtz John
  292.  
  293. -----------------------------------------------------------------------
  294.  John.Hendrikx@grafix.xs4all.nl   TextDemo/FastView/Etc... development
  295. -----------------------------------------------------------------------
  296. -- Via Xenolink 1.981, XenolinkUUCP 1.1
  297.